import 'package:get/get.dart';

class CounterController extends GetxController{
  RxInt counter = 0.obs;

  void inc(){
    counter++;
    //必须调用update(),否则不会调用Obx()方法局部更新widget
    update();
  }

  void dec(){
    counter--;
    update();
  }

}
